package com.ds.admin.org.role;

import com.ds.admin.iorg.role.IRoleTree;
import com.ds.esd.custom.tree.annotation.TreeItemAnnotation;
import com.ds.esd.tool.ui.component.list.TreeListItem;
import com.ds.org.RoleOtherType;
import com.ds.org.RoleType;


public class RoleTree<T> extends TreeListItem implements IRoleTree {


    RoleOtherType roleOtherType;

    RoleType roleType;

    String caption;


    @TreeItemAnnotation(bindService = RoleTreeAPI.class, dynDestory = true, lazyLoad = true)
    public RoleTree(RoleOtherType type) {
        this.caption = type.getName();
        this.imageClass = type.getImageClass();
        this.roleOtherType = type;
    }

    @TreeItemAnnotation(bindService = RoleTreeAPI.class)
    public RoleTree(RoleType type) {
        this.caption = type.getName();
        this.imageClass = type.getImageClass();
        this.roleType = type;
    }

    public RoleOtherType getRoleOtherType() {
        return roleOtherType;
    }

    public void setRoleOtherType(RoleOtherType roleOtherType) {
        this.roleOtherType = roleOtherType;
    }

    public RoleType getRoleType() {
        return roleType;
    }

    public void setRoleType(RoleType roleType) {
        this.roleType = roleType;
    }

    @Override
    public String getCaption() {
        return caption;
    }

    @Override
    public void setCaption(String caption) {
        this.caption = caption;
    }
}
